import 'package:erp/widgets/load_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get_state_manager/src/simple/get_state.dart';

import 'controller.dart';

export 'binding.dart';

class SplashPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    Gradient gradient = LinearGradient(
      colors: [Color(0xff9DE1F7), Color(0xff51A5E6)],
    );
    Shader shader = gradient.createShader(Rect.fromLTWH(0, 0, size.width, size.height));
    return Scaffold(
      body: GetBuilder<SplashController>(
        builder: (_) {
          return Stack(
            alignment: AlignmentDirectional.center,
            children: [
              Positioned(
                top: 312.h,
                left: 210.w,
                child: LoadAssetImage("start/logo"),
                width: 328.w,
                height: 240.h,
              ),
              Positioned(
                left: 180.w,
                right: 180.w,
                top: 520.h,
                child: Text(
                  "ERP工作管理系统",
                  textAlign: TextAlign.center,
                  style: TextStyle(
                    foreground: Paint()..shader = shader,
                    fontSize: 47.sp,
                    fontFamily: 'SourceHanSansCN',
                  ),
                ),
              ),
              Positioned(
                bottom: 123.h,
                left: 222.w,
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Text(
                      'CICT',
                      style: TextStyle(
                        color: Color(0xff5BA6E4),
                        fontWeight: FontWeight.bold,
                        fontSize: 31.sp,
                        fontFamily: 'MicrosoftYaHei',
                      ),
                    ),
                    SizedBox(width: 6.w),
                    SizedBox(
                      width: 2.w,
                      height: 20.h,
                      child: DecoratedBox(
                        decoration: BoxDecoration(
                          color: Color.fromRGBO(91, 166, 228, 0.5),
                        ),
                      ),
                    ),
                    SizedBox(width: 6.w),
                    Text(
                      '长江慧控科技集团',
                      style: TextStyle(
                        color: Color(0xff5BA6E4),
                        fontSize: 24.sp,
                        fontFamily: 'MicrosoftYaHei',
                      ),
                    )
                  ],
                ),
              ),
              Positioned(
                left: 150.w,
                bottom: 84.h,
                child: Text(
                  "CHANGJIANG INTELLIGENT LECHNOLOGY GROUP",
                  style: TextStyle(
                    color: Color(0xffcccccc),
                    fontSize: 19.sp,
                    fontFamily: 'MicrosoftYaHei',
                  ),
                ),
              ),
            ],
          );
        },
      ),
    );
  }
}
